package com.aios.action.user.system;

import java.util.List;

import com.aios.entity.Controller;
import com.aios.entity.SwitchPanel;

public class SystemUserViewAction extends AbstractSystemUserAction {

	private static final long serialVersionUID = 1L;
	
	private List<Controller> controllerList;
	private List<SwitchPanel> switchPanelList;

	public String execute() {
		try {
			this.systemUser = systemUserService
					.selectActiveUserByPrimaryKey(id);
			if(systemUser != null) {
				this.controllerList = controllerService.findControllerByUserID(id);
				this.switchPanelList = switchPanelService.findByUserId(id);
			}
		} catch (Exception e) {
			// logger
			e.printStackTrace();
			addActionError(getText("error.user.notfound"));
			return INPUT;
		}

		return SUCCESS;
	}

	public List<Controller> getControllerList() {
		return controllerList;
	}

	public void setControllerList(List<Controller> controllerList) {
		this.controllerList = controllerList;
	}

	public List<SwitchPanel> getSwitchPanelList() {
		return switchPanelList;
	}

	public void setSwitchPanelList(List<SwitchPanel> switchPanelList) {
		this.switchPanelList = switchPanelList;
	}
	
	

}
